
import request from '@/utils/request'
    // 查询分组信息表列表
    export const listGroup = (query) => {
    return request({
        url: '/system/group/list',
        method: 'get',
        params: query
    })
    }
    // 查询可分配分组信息表列表
    export const listGroupForAllocate = (query) => {
    return request({
        url: '/system/group/listForAllocate',
        method: 'get',
        params: query
    })
    }
    // 查询分组信息表详细
    export const getGroup = (groupId) => {
    return request({
        url: '/system/group/' + groupId,
        method: 'get'
    })
    }
    
    // 新增分组信息表
    export const addGroup = (data) => {
    return request({
        url: '/system/group',
        method: 'post',
        data: data
    })
    }
    // 根据年级和教师查询分组信息表列表
    export const listByGradeAndTeacher = (gradeId, teacherId) => {
    return request({
        url: '/system/group/listByGradeAndTeacher/' + gradeId + '/teacher/' + teacherId,
        method: 'get'
    })
    }
    // 修改分组信息表
    export const updateGroup = (data) => {    
    return request({
        url: '/system/group',
        method: 'put',
        data: data
    })
    }

    // 删除分组信息表
    export const delGroup = (groupId) => {  
    return request({
        url: '/system/group/' + groupId,
        method: 'delete'
    })
    }
    
    // 导出分组信息表
    export const exportGroup = (data) => {
    return request({
        url: '/system/group/export',
        method: 'post',
        data: data
    })
}
// 获取当前分组的可选学生列表（支持传入查询对象，如 {isTeam:1,pageNum,pageSize}）
export const getInfo = (groupId, query) => {
    return request({
        url: '/system/group/' + groupId + '/student/list',
        method: 'get',
        params: query
    })
}

// 获取分组教师列表
export const getGroupTeachers = (groupId) => {
    return request({
        url: '/system/group/' + groupId + '/teacher/list',
        method: 'get'
    })
}
export const listByGrade = (gradeId) => {
    return request({
        url: '/system/group/listByGrade/' + gradeId,
        method: 'get'
    })
}